<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                template="./../templates/defaultTemplate.xhtml"
                xmlns:c="http://java.sun.com/jsp/jstl/core">
    <ui:define name="top">
        <h:outputLink value="#{subjectThread.basePath}/index.xhtml">
            Accueil
        </h:outputLink>
    </ui:define>
    <ui:define name="content">
        Pour modifier votre compte, remplissez les champs que vous souhaitez modifier :

        <h:form class="edition">
            Pour modifier votre mot de passe, remplissez ce formulaire :
            <h:panelGrid id="panel" columns="3" border="0" cellpadding="0" cellspacing="2">
                <h:outputLabel value="Votre ancien mot de passe : "/>
                <h:inputSecret id="password" value="#{jarjarbean.password}"/>
                <h:outputLabel value="#{jarjarbean.errorPass}" style="color: red"/>

                <h:outputLabel value="Votre nouveau mot de passe : "/>
                <h:inputSecret id="password1" value="#{jarjarbean.password1}"/>
                <h:outputLabel value="#{jarjarbean.errorPass1}" style="color: red"/>

                <h:outputLabel value="Votre nouveau mot de passe (confirmation) : "/>
                <h:inputSecret id="password2" value="#{jarjarbean.password2}"/>
                <h:outputLabel value="#{jarjarbean.errorPass2}" style="color: red"/>
                <h:commandButton class="button" action="#{jarjarbean.editMyPassword()}" value="Enregistrer"/>

            </h:panelGrid>
        </h:form>
        <h:form class="edition">
            Pour modifier votre pseudo, nom ou prénom, modifiez les information de ce formulaire :
            
            <h:panelGrid id="panel" columns="3" border="0" cellpadding="0" cellspacing="2">
                <h:outputLabel value="Votre pseudo : "/>
                <h:inputText id="pseudo" value="#{jarjarbean.pseudo}"/>
                <h:outputLabel value="#{jarjarbean.errorPseudo}" style="color: red"/>

                <h:outputLabel value="Votre nom : "/>
                <h:inputText id="name" value="#{jarjarbean.name}"/>
                <h:outputLabel value="#{jarjarbean.errorName}" style="color: red"/>

                <h:outputLabel value="Votre prénom : "/>
                <h:inputText id="firstname" value="#{jarjarbean.firstname}"/>
                <h:outputLabel value="#{jarjarbean.errorFirstName}" style="color: red"/>

                <h:commandButton class="button" action="#{jarjarbean.editMyAccount()}" value="Enregistrer"/>

            </h:panelGrid>
        </h:form>
        
        <h:form>
            <h:outputLabel value="Ma signature :"/>
            <h:inputTextarea rows="10" cols="60" value="#{jarjarbean.signature}"/>
            <h:commandButton class="button" action="#{jarjarbean.editMySignature()}" value="Enregistrer"/>
        </h:form>
    </ui:define>
</ui:composition>